#include <avr/io.>

#include "hd44780_low.h"
#include "hd44780fw.h"
#include "inf1995_init_hd44780.h"

void inf1995_init_hd44780(volatile uint8_t* ddr, volatile uint8_t* port,
struct hd44780fw_conf* fw_conf, struct hd44780_l_conf* low_conf) {
	*ddr |= (_BV(7) | _BV(6) | _BV(5) | _BV(4) | _BV(3) | _BV(2) | _BV(1));
	low_conf->rs_i = 7;
	low_conf->rw_i = 6;
	low_conf->en_i = 5;
	low_conf->db7_i = 4;
	low_conf->db6_i = 3;
	low_conf->db5_i = 2;
	low_conf->db4_i = 1;
	low_conf->rs_port = low_conf->rw_port = low_conf->en_port =
		low_conf->db7_port = low_conf->db6_port = low_conf->db5_port =
		low_conf->db4_port = port;
	low_conf->line1_base_addr = 0x00;
	low_conf->line2_base_addr = 0x40;
	low_conf->dl = HD44780_L_FS_DL_4BIT;
	fw_conf->low_conf = low_conf;
	fw_conf->total_chars = 32;
	fw_conf->font = HD44780_L_FS_F_58;
	fw_conf->lines = HD44780_L_FS_N_DUAL;
}
